package com.lyx.bank.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lyx.bank.entity.TransactionRecord;
import com.lyx.bank.feign.RecordsFeign;
import com.lyx.bank.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TransactionRecordController
 * @Description: TODO
 * @Author 86152
 * @Date 2022/4/22
 * @Version V1.0
 **/
@Api(tags = "账单模块")
@RestController
public class TransactionRecordController {

    @Autowired
    RecordsFeign recordsFeign;


    @ApiOperation("分页查询")
    @GetMapping("/getRecords")
    public Result getRecords(

            @RequestParam(value = "current",required = true,defaultValue = "1") Integer current,
            @RequestParam(value = "size",required = true,defaultValue = "2") Integer size,
            @RequestParam(value = "cardNo") String cardNo,
            @RequestParam(value = "oneDate",required = false) String oneDate,
            @RequestParam(value = "towDate",required = false)  String towDate){
        Result records = recordsFeign.records(current,size,cardNo, oneDate, towDate);
          return Result.ok().data("records",records);
    }

}
